<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||	
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws. 
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.). 
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations). 
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/modules/Event/classes/PhpFox_ComponentFeaturedEvents.class.php, $Author:  $ */



/** Component for listing featured events
 * @version $Id: PhpFox_ComponentFeaturedEvents.class.php 46 2007-12-14 23:12:21Z phpfoxsv $
 * @package module.event
 *   
 */
class PhpFox_Mod_Event_ComponentFeaturedEvents extends BaseComponent
{
    function process()
    {
        $oEventItem = $this->_oModule->getItem('Event');
        /* @var $oEventItem PhpFox_Mod_Event_ItemEvent */
        $oEventService = $this->_oModule->getService('Event');
        /* @var $oEventService PhpFox_Mod_Event_ServiceEvent */
        $oSecurityService = &App::getModuleService('Account', 'Security');
        /* @var $oSecurityService PhpFox_Mod_Account_ServiceSecurity */
        $oTpl = $this->_oModule->getTemplate();

        $oSecurityService->checkPerm('events', array('read_only', 'full'));
        $oSecurityService->checkAccess('events');
        $aCond = array();
        $aCond['feature'] = '= 1';
        $sSort = 'RAND()';
        $iCount = App::getParam('public.featured_events');
        list($aItems, $iCnt) = $oEventService->getEventList($aCond, 1, $iCount, $sSort);

        $oTpl->assign(array(
        	'aItems' => $aItems,
        ));
        return $oTpl->fetch('FeaturedEvents.html');
    }
}
?>